package com.cloud.DrugManagement.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cloud.DrugManagement.pojo.Drugs;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

/**
 * @author zhozixiong
 * @date 2023/02/06
 */
@Mapper
@Repository
public interface DrugsMapper extends BaseMapper<Drugs> {

    Page<Drugs> userSearchDrugs(Page page, @Param("parameter") Object parameter);

    Page<Drugs> adminSearchDrugs(Page page, @Param("parameter") Object parameter);

    Drugs searchAllByDid(@Param("did") int did);

    @Override
    int insert(@Param("drugs") Drugs drugs);

    int updateAllByDid(@Param("drugs") Drugs drugs);

    int updateRetailPriceByDid(@Param("retailPrice") double retailPrice, int did);

    int delByDid(@Param("did") Integer did);
}
